package com.nut.lmsc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nut.lmsc.entity.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {

    @Select("select menu_id from sys_role_menu where role_id=#{roleId}")
    List<Integer> selectMenuIds(Integer roleId);

    @Select("select b.permission from sys_role_menu a left join sys_menu b on a.menu_id=b.id where a.role_id=#{roleId}")
    List<Integer> selectPermissionByRoleId(Integer roleId);

}
